// license-header java merge-point
/**
 * This is only generated once! It will never be overwritten.
 * You can (and have to!) safely modify it by hand.
 */
package org.tinaelle.server.domain;
/**
 * @see org.tinaelle.server.domain.AdValRule
 */
public class AdValRuleDaoImpl
    extends org.tinaelle.server.domain.AdValRuleDaoBase
{
    /**
     * @see org.tinaelle.server.domain.AdValRuleDao#toAdValRuleDTO(org.tinaelle.server.domain.AdValRule)
     */
    public org.tinaelle.common.dto.AdValRuleDTO toAdValRuleDTO(final org.tinaelle.server.domain.AdValRule entity)
    {
        return super.toAdValRuleDTO(entity);
    }

    /**
     * Retrieves the entity object that is associated with the specified value object
     * from the object store. If no such entity object exists in the object store,
     * a new, blank entity is created
     */
    private org.tinaelle.server.domain.AdValRule loadAdValRuleFromAdValRuleDTO(org.tinaelle.common.dto.AdValRuleDTO adValRuleDTO)
    {
        org.tinaelle.server.domain.AdValRule adValRule = this.load(adValRuleDTO.getAdValRuleId());
        if (adValRule == null)
        {
            adValRule = org.tinaelle.server.domain.AdValRule.Factory.newInstance();
        }
        return adValRule;
    }

    
    /**
     * @see org.tinaelle.server.domain.AdValRuleDao#adValRuleDTOToEntity(org.tinaelle.common.dto.AdValRuleDTO)
     */
    public org.tinaelle.server.domain.AdValRule adValRuleDTOToEntity(org.tinaelle.common.dto.AdValRuleDTO adValRuleDTO)
    {
        org.tinaelle.server.domain.AdValRule entity = this.loadAdValRuleFromAdValRuleDTO(adValRuleDTO);
        this.adValRuleDTOToEntity(adValRuleDTO, entity, true);
        return entity;
    }
}